import http from './util/request/index'

// post请求
export const POST = (url, data) => http.post(url, data, {header: {'Content-Type': 'application/json;charset=UTF-8'}})

// get请求
export const GET = (url, data) => http.get(url, {params: data, header: {'Content-Type': 'application/x-www-form-urlencoded'}})

// put请求
export const PUT = (url, data) => http.put(url, data, {header: {'Content-Type': 'application/json;charset=UTF-8'}})

// delete请求
export const DELETE = (url, data) => http.delete(url, {params: data, header: {'Content-Type': 'application/x-www-form-urlencoded'}})

// // 批量upload请求
// export const UPLOAD_BATCH = (url, files=[], formData) => http.upload(url, {files: files, formData: formData})

// // upload请求
export const UPLOAD = (url, filePath, fileName='file', formData) => http.upload(url, {filePath: filePath, name: fileName, formData: formData})

// // download请求（未测试，后面根据需要再进行封装）
// export const DOWNLOAD = (url, params={}) => http.download(url, {params: params, header: {'Content-Type': 'application/json;charset=UTF-8'}})
// post请求
export const UPLOADFILE = (url, data) => http.post(url, data, {header: {'Content-Type': 'multipart/form-data','Filetype':'04'}})

export default {
	POST,
	GET,
	PUT,
	DELETE,
	UPLOADFILE,
	// UPLOAD_BATCH,
	UPLOAD,
	// DOWNLOAD
}